package pl.pawluk.inz.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author: toshiba
 * Date: 01.03.13
 * Time: 20:08
 * To change this template use File | Settings | File Templates.
 */
public class HelloController {

    @RequestMapping("/index")
    public ModelAndView hello(@RequestParam(value = "name", defaultValue = "Visitor") String name) {
        ModelAndView view = new ModelAndView("helloView");
        view.addObject("helloMessage", "Hello, " + name + "!");
        return view;
    }
}